<?php
/** 
 * Perform data caching/restoring from cache
 * 
 * @author Konstantin Shamko <konstantin.shamko@gmail.com> 
 * @version 0.0.1
 * @copyright  Copyright (c) 2009 Konstantin Shamko
 * @category VaselinEngine
 * @package Bel Classes
 * @license  New BSD License
 *
 */
class Bel_Cache extends Zend_Cache_Core {	
   /**
     * If DEV_MODE is off test if a cache is available for the given id and (if yes) return it (false else)
     *
     * @param  string  $id                     Cache id
     * @param  boolean $doNotTestCacheValidity If set to true, the cache validity won't be tested
     * @param  boolean $doNotUnserialize       Do not serialize (even if automatic_serialization is true) => for internal use
     * @return mixed|false Cached datas
     */	
	public function load($id, $doNotTestCacheValidity = false, $doNotUnserialize = false) {
		if (DEV_MODE) {
			return false;
		}		
		return parent::load ( $id, $doNotTestCacheValidity, $doNotUnserialize );
	}
    /**
     * If DEV_MODE is off save some data in a cache
     *
     * @param  mixed $data           Data to put in cache (can be another type than string if automatic_serialization is on)
     * @param  string $id             Cache id (if not set, the last cache id will be used)
     * @param  array $tags           Cache tags
     * @param  int $specificLifetime If != false, set a specific lifetime for this cache record (null => infinite lifetime)
     * @param  int   $priority         integer between 0 (very low priority) and 10 (maximum priority) used by some particular backends
     * @throws Zend_Cache_Exception
     * @return boolean True if no problem
     */	
	public function save($data, $id = null, $tags = array(), $specificLifetime = false,$priority = 8) {
	
		if(DEV_MODE){
			return false;
		}
		
		return parent::save($data, $id, $tags, $specificLifetime,$priority);
	}
}